using System.Data.Entity.ModelConfiguration;
using HBCode.BusinessLogic.Entities;

namespace HBCode.BusinessLogic.Mapping
{
	public class CategoryMap : EntityTypeConfiguration<Category>
	{
		public CategoryMap()
		{
			// Primary Key
			this.HasKey(t => t.CategoryID);

			// Properties
			this.Property(t => t.CategoryName)
				.HasMaxLength(50);
				
			// Table & Column Mappings
			this.ToTable("Category");
			this.Property(t => t.CategoryID).HasColumnName("CategoryID");
			this.Property(t => t.CategoryName).HasColumnName("CategoryName");
		}
	}
}

